<template>
  <el-dialog
    :visible.sync="localVisible"
    title="添加任务"
    class="new-plan-dialog"
    width="25%"
  >
    <el-date-picker
      v-model="planMonth"
      type="week"
      format="yyyy 第 WW 周"
      placeholder="选择周"
    >
    </el-date-picker>
    <el-input
      placeholder="请输入任务名称"
      v-model="planName"
      style="margin-top: 20px"
    ></el-input>
    <el-input
      placeholder="请输入任务描述"
      type="textarea"
      style="margin-top: 20px"
      rows="5"
      v-model="PalnContent"
    ></el-input>
    <template slot="footer">
      <el-button>取消</el-button>
      <el-button type="primary">确定</el-button>
    </template>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      localVisible: this.visible,
      planName: "",
      PalnContent: "",
      planMonth: "",
    };
  },
  name: "newPlan",
  props: {
    selectedName: {
      type: String,
      default: "",
    },
    visible: {
      type: Boolean,
      default: false,
    },
  },
  watch: {
    visible(newVal) {
      this.localVisible = newVal;
    },
    localVisible(newVal) {
      this.$emit("update:visible", newVal);
    },
  },
};
</script>
